#pragma once

#include"RBTree.h"

namespace Alpaca
{
	template<class K>
	class set
	{
	public:
		struct KeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
		typedef typename RBTree<K, K, KeyOfT>::iterator iterator;

		pair<iterator, bool> insert(const K& key)
		{
			return _t.Insert(key);
		}

		iterator begin()
		{
			return _t.begin();
		}

		iterator end()
		{
			return _t.end();
		}


	private:
		RBTree<K, K, KeyOfT> _t;
	};

	void textset1()
	{
		set<int> s1;
		int arr[] = { 3,1,15,16,4,7,9,13,14 };
		for (auto it : arr)
		{
			s1.insert(it);
		}

		auto it = s1.begin();
		while (it != s1.end())
		{
			cout << *it << " ";
			++it;
		}
		cout << endl;
	}
}